package com.unidt.www.module.bpm.dal.mysql.task;

import com.unidt.www.framework.mybatis.core.mapper.BaseMapperX;
import com.unidt.www.module.bpm.dal.dataobject.task.BpmProcessTaskExtDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface BpmProcessTaskExtMapper extends BaseMapperX<BpmProcessTaskExtDO> {

//    default PageResult<BpmProcessInstanceExtDO> selectPage(Long userId, BpmProcessInstanceMyPageReqVO reqVO) {
//        return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
//                .eqIfPresent(BpmProcessInstanceExtDO::getStartUserId, userId)
//                .likeIfPresent(BpmProcessInstanceExtDO::getName, reqVO.getName())
//                .eqIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, reqVO.getProcessDefinitionId())
//                .eqIfPresent(BpmProcessInstanceExtDO::getCategory, reqVO.getCategory())
//                .eqIfPresent(BpmProcessInstanceExtDO::getStatus, reqVO.getStatus())
//                .eqIfPresent(BpmProcessInstanceExtDO::getResult, reqVO.getResult())
//                .betweenIfPresent(BpmProcessInstanceExtDO::getCreateTime, reqVO.getCreateTime())
//                .orderByDesc(BpmProcessInstanceExtDO::getId));
//    }
//
//    default BpmProcessInstanceExtDO selectByProcessInstanceId(String processInstanceId) {
//        return selectOne(BpmProcessInstanceExtDO::getProcessInstanceId, processInstanceId);
//    }
//
//    default List<BpmProcessInstanceExtDO> selectListByDefinitionId(String definitionId) {
//        return selectList(BpmProcessInstanceExtDO::getProcessDefinitionId, definitionId);
//    }
//
//    default void updateByProcessInstanceId(BpmProcessInstanceExtDO updateObj) {
//        update(updateObj, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
//                .eq(BpmProcessInstanceExtDO::getProcessInstanceId, updateObj.getProcessInstanceId()));
//    }
//    default void updateByTaskId(BpmProcessInstanceExtDO updateObj) {
//        update(updateObj, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
//                .eq(BpmProcessInstanceExtDO::getTaskId, updateObj.getTaskId()));
//    }
    default void insertByTaskId(BpmProcessTaskExtDO updateObj) {
       insert(updateObj);
    }
    default BpmProcessTaskExtDO  selectByTaskId(BpmProcessTaskExtDO updateObj) {
        return selectOne(BpmProcessTaskExtDO::getTaskId, updateObj.getTaskId());
    }
}
